// run: $exec < input
#include <iostream>
#include <map>

std::string name[12] = {
							"Rat",
							"Ox",
							"Tiger",
							"Rabbit",
							"Dragon",
							"Snake",
							"Horse",
							"Ram",
							"Monkey",
							"Rooster",
							"Dog",
							"Pig",
						};

int main()
{
	std::ios::sync_with_stdio(false);
	int n;
	std::cin >> n;
	for (int i = 0, x; i < n; i++) {
		std::cin >> x;
		x--;
		int t = x % 12;
		t = 3 - t;
		t = (t + 24) % 12;
		std::cout << name[t] << '\n';
	}
}

